3.1.72 \(\int \frac {\sqrt {1+x^2}}{-1+x^2} \, dx\) [72]

Optimal. Leaf size=27 \[ \sinh ^{-1}(x)-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {1+x^2}}\right ) \]

[Out]

arcsinh(x)-arctanh(x*2^(1/2)/(x^2+1)^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {399, 221, 385, 213} \begin {gather*} \sinh ^{-1}(x)-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {x^2+1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[1 + x^2]/(-1 + x^2),x]

[Out]

ArcSinh[x] - Sqrt[2]*ArcTanh[(Sqrt[2]*x)/Sqrt[1 + x^2]]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 399

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Dist[b/d, Int[(a + b*x^n)^(p - 1), x]
, x] - Dist[(b*c - a*d)/d, Int[(a + b*x^n)^(p - 1)/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b*c
 - a*d, 0] && EqQ[n*(p - 1) + 1, 0] && IntegerQ[n]

Rubi steps

\begin {align*} \int \frac {\sqrt {1+x^2}}{-1+x^2} \, dx &=2 \int \frac {1}{\left (-1+x^2\right ) \sqrt {1+x^2}} \, dx+\int \frac {1}{\sqrt {1+x^2}} \, dx\\ &=\sinh ^{-1}(x)+2 \text {Subst}\left (\int \frac {1}{-1+2 x^2} \, dx,x,\frac {x}{\sqrt {1+x^2}}\right )\\ &=\sinh ^{-1}(x)-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {1+x^2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 45, normalized size = 1.67 \begin {gather*} \tanh ^{-1}\left (\frac {x}{\sqrt {1+x^2}}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {1-x^2+x \sqrt {1+x^2}}{\sqrt {2}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[1 + x^2]/(-1 + x^2),x]

[Out]

ArcTanh[x/Sqrt[1 + x^2]] - Sqrt[2]*ArcTanh[(1 - x^2 + x*Sqrt[1 + x^2])/Sqrt[2]]

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(83\) vs. \(2(21)=42\).
time = 0.19, size = 84, normalized size = 3.11

method result size
trager \(-\ln \left (-\sqrt {x^{2}+1}+x \right )-\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) \ln \left (-\frac {3 \RootOf \left (\textit {\_Z}^{2}-2\right ) x^{2}+4 \sqrt {x^{2}+1}\, x +\RootOf \left (\textit {\_Z}^{2}-2\right )}{\left (x -1\right ) \left (x +1\right )}\right )}{2}\) \(65\)
default \(-\frac {\sqrt {\left (x +1\right )^{2}-2 x}}{2}+\arcsinh \left (x \right )+\frac {\sqrt {2}\, \arctanh \left (\frac {\left (2-2 x \right ) \sqrt {2}}{4 \sqrt {\left (x +1\right )^{2}-2 x}}\right )}{2}+\frac {\sqrt {\left (x -1\right )^{2}+2 x}}{2}-\frac {\sqrt {2}\, \arctanh \left (\frac {\left (2+2 x \right ) \sqrt {2}}{4 \sqrt {\left (x -1\right )^{2}+2 x}}\right )}{2}\) \(84\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+1)^(1/2)/(x^2-1),x,method=_RETURNVERBOSE)

[Out]

-1/2*((x+1)^2-2*x)^(1/2)+arcsinh(x)+1/2*2^(1/2)*arctanh(1/4*(2-2*x)*2^(1/2)/((x+1)^2-2*x)^(1/2))+1/2*((x-1)^2+
2*x)^(1/2)-1/2*2^(1/2)*arctanh(1/4*(2+2*x)*2^(1/2)/((x-1)^2+2*x)^(1/2))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (21) = 42\).
time = 0.50, size = 59, normalized size = 2.19 \begin {gather*} -\frac {1}{2} \, \sqrt {2} \operatorname {arsinh}\left (\frac {2 \, x}{{\left | 2 \, x + 2 \right |}} - \frac {2}{{\left | 2 \, x + 2 \right |}}\right ) - \frac {1}{2} \, \sqrt {2} \operatorname {arsinh}\left (\frac {2 \, x}{{\left | 2 \, x - 2 \right |}} + \frac {2}{{\left | 2 \, x - 2 \right |}}\right ) + \operatorname {arsinh}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)^(1/2)/(x^2-1),x, algorithm="maxima")

[Out]

-1/2*sqrt(2)*arcsinh(2*x/abs(2*x + 2) - 2/abs(2*x + 2)) - 1/2*sqrt(2)*arcsinh(2*x/abs(2*x - 2) + 2/abs(2*x - 2
)) + arcsinh(x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 67 vs. \(2 (21) = 42\).
time = 0.43, size = 67, normalized size = 2.48 \begin {gather*} \frac {1}{2} \, \sqrt {2} \log \left (\frac {9 \, x^{2} - 2 \, \sqrt {2} {\left (3 \, x^{2} + 1\right )} - 2 \, \sqrt {x^{2} + 1} {\left (3 \, \sqrt {2} x - 4 \, x\right )} + 3}{x^{2} - 1}\right ) - \log \left (-x + \sqrt {x^{2} + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)^(1/2)/(x^2-1),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*log((9*x^2 - 2*sqrt(2)*(3*x^2 + 1) - 2*sqrt(x^2 + 1)*(3*sqrt(2)*x - 4*x) + 3)/(x^2 - 1)) - log(-x
+ sqrt(x^2 + 1))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {x^{2} + 1}}{\left (x - 1\right ) \left (x + 1\right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+1)**(1/2)/(x**2-1),x)

[Out]

Integral(sqrt(x**2 + 1)/((x - 1)*(x + 1)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (21) = 42\).
time = 0.87, size = 70, normalized size = 2.59 \begin {gather*} -\frac {1}{2} \, \sqrt {2} \log \left (\frac {{\left | 2 \, {\left (x - \sqrt {x^{2} + 1}\right )}^{2} - 4 \, \sqrt {2} - 6 \right |}}{{\left | 2 \, {\left (x - \sqrt {x^{2} + 1}\right )}^{2} + 4 \, \sqrt {2} - 6 \right |}}\right ) - \log \left (-x + \sqrt {x^{2} + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)^(1/2)/(x^2-1),x, algorithm="giac")

[Out]

-1/2*sqrt(2)*log(abs(2*(x - sqrt(x^2 + 1))^2 - 4*sqrt(2) - 6)/abs(2*(x - sqrt(x^2 + 1))^2 + 4*sqrt(2) - 6)) -
log(-x + sqrt(x^2 + 1))

________________________________________________________________________________________

Mupad [B]
time = 0.17, size = 59, normalized size = 2.19 \begin {gather*} \mathrm {asinh}\left (x\right )+\frac {\sqrt {2}\,\left (\ln \left (x-1\right )-\ln \left (x+\sqrt {2}\,\sqrt {x^2+1}+1\right )\right )}{2}-\frac {\sqrt {2}\,\left (\ln \left (x+1\right )-\ln \left (\sqrt {2}\,\sqrt {x^2+1}-x+1\right )\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 + 1)^(1/2)/(x^2 - 1),x)

[Out]

asinh(x) + (2^(1/2)*(log(x - 1) - log(x + 2^(1/2)*(x^2 + 1)^(1/2) + 1)))/2 - (2^(1/2)*(log(x + 1) - log(2^(1/2
)*(x^2 + 1)^(1/2) - x + 1)))/2

________________________________________________________________________________________